import * as React from 'react';
import {Datagrid} from "@/components/datagrid";
import {Form} from "@/components/form";
import {serverFetch} from "@/components/server-fetch";


export default async function Page() {
    const api_type = 'equipment'
    const data = await serverFetch(api_type)
    const dataJson = {
        equipmentId: {name: '设备编号', type: 'number'},
        name: {name: '设备名称', type: 'string'},
        type: {name: '设备类型', type: 'string'},
        status: {name: '设备状态', type: 'string'},
        plcController: {name: 'PLC控制器', type: 'string'},
        pruchaseDate: {name: '购买日期', type: 'string'},
        description: {name: '设备描述', type: 'string'},
    }
    return (
        <main className='px-5'>
            <p className="text-3xl py-5">
                # 设备信息
            </p>
            <Datagrid rows={data.data} keyword={'equipmentId'} list={dataJson} type={api_type}/>
            <Form list={dataJson} type={api_type}/>
        </main>
    )
}
